package org.mtmi.ui.scenes.actions;

import org.mtmi.ui.IMG;
import org.mtmi.ui.actions.Action;
import org.mtmi.ui.drawables.IDrawable;
import org.mtmi.ui.scenes.SceneManager;

public class ToggleEditSceneModeAction extends Action
{
	public ToggleEditSceneModeAction() {
		super( PUSH );
	}
	
	@Override
	public String getText() {
		if( SceneManager.getDefault().isEditing() ) {
			return "Play Scene";
		} else {
			return "Edit Scene";			
		}
	}
	
	@Override
	public IDrawable getImage() {
		if( SceneManager.getDefault().isEditing() ) {
			return IMG.GetD( IMG.I_PLAY );
		} else {
			return IMG.GetD( IMG.I_EDIT );			
		}
	}
	
	@Override
	public boolean isEnabled() {
		return true;
	}
	
	@Override
	public void run() {
		SceneManager.getDefault().setEditing( !SceneManager.getDefault().isEditing() );
	}
}
